Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flyteagent] Add agents and agentForTaskTypes in helm chart #6239

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

mao3267
Copy link
Contributor

@mao3267 mao3267 commented Feb 11, 2025

Tracking issue

#3936

Why are the changes needed?

We aim to enhance the default configuration by adding more customization options for agent users. Specifically, we are introducing custom agent deployments in AgentDeployments and defining task types for specific agents in AgentForTaskTypes. These additions enable greater flexibility across various scenarios.

What changes were proposed in this pull request?

  1. Add AgentDeployments and AgentForTaskTypes in default config
  2. Test the correctness of the default configuration content and verify the task type-to-agent matching.

How was this patch tested?

  1. Modify the existing test to check new added labels (AgentDeployments, AgentForTaskTypes)
  2. Add new test to check matching between task types and agents.

Labels

added

Setup process

git clone https://github.com/flyteorg/flyte.git
gh pr checkout 6239

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

#6179

Docs link

None

Summary by Bito

This PR enhances Flyte agent configuration by introducing custom agent deployments and task type mapping in Helm charts. The implementation adds timeouts for agent operations, configures custom agent endpoints, and establishes task type to agent mappings. The changes improve flexibility and customization options while including comprehensive test coverage.

Unit tests added: True

Estimated effort to review (1-5, lower is better): 5

@flyte-bot
Copy link
Collaborator

Code Review Agent Run Status

  • Limitations and other issues: ❌ Failure - The AI Code Review Agent skipped reviewing this change because it is configured to exclude certain pull requests based on the source/target branch or the pull request status. You can change the settings here, or contact the agent instance creator at [email protected].

Copy link

codecov bot commented Feb 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 36.86%. Comparing base (ee919f8) to head (a490251).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6239   +/-   ##
=======================================
  Coverage   36.86%   36.86%           
=======================================
  Files        1318     1318           
  Lines      134767   134767           
=======================================
+ Hits        49684    49685    +1     
+ Misses      80753    80752    -1     
  Partials     4330     4330           
Flag Coverage Δ
unittests-datacatalog 51.58% <ø> (ø)
unittests-flyteadmin 51.87% <ø> (ø)
unittests-flytecopilot 30.99% <ø> (ø)
unittests-flytectl 62.29% <ø> (ø)
unittests-flyteidl 7.22% <ø> (ø)
unittests-flyteplugins 54.03% <ø> (ø)
unittests-flytepropeller 42.78% <ø> (ø)
unittests-flytestdlib 55.35% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Future-Outlier
Copy link
Member

This is the updated configmap!
before configmap:

      agent-service:
        defaultAgent:
          defaultTimeout: 10s
          endpoint: k8s://flyteagent.flyte:8000
          insecure: true
          timeouts:
            GetTask: 10s

after

      agent-service:
        agentForTaskTypes:
        - noop_task: custom_agent
        agents:
          custom_agent:
            endpoint: k8s://flyte_custom_agent.flyte:8000
            insecure: true
        defaultAgent:
          defaultTimeout: 10s
          endpoint: k8s://flyteagent.flyte:8000
          insecure: true
          timeouts:
            CreateTask: 10s
            DeleteTask: 10s
            ExecuteTaskSync: 10s
            GetTask: 10s
        supportedTaskTypes: []

Signed-off-by: Future-Outlier <[email protected]>
@Future-Outlier Future-Outlier changed the title [WIP][flyteagent][test] Default Plugin Config [flyteagent] Add agents and agentForTaskTypes in helm chart Feb 17, 2025
@Future-Outlier Future-Outlier self-assigned this Feb 17, 2025
@Future-Outlier Future-Outlier marked this pull request as ready for review February 17, 2025 03:26
Signed-off-by: Future-Outlier <[email protected]>
@flyte-bot
Copy link
Collaborator

flyte-bot commented Feb 17, 2025

Code Review Agent Run #5f1d05

Actionable Suggestions - 2
  • docker/sandbox-bundled/manifests/complete-agent.yaml - 1
  • flyteplugins/go/tasks/plugins/webapi/agent/config_test.go - 1
Review Details
  • Files reviewed - 9 · Commit Range: 59b8eab..a490251
    • charts/flyte-binary/values.yaml
    • charts/flyte-core/values.yaml
    • docker/sandbox-bundled/manifests/complete-agent.yaml
    • docker/sandbox-bundled/manifests/complete.yaml
    • docker/sandbox-bundled/manifests/dev.yaml
    • flyteplugins/go/tasks/plugins/webapi/agent/config.go
    • flyteplugins/go/tasks/plugins/webapi/agent/config_test.go
    • go.mod
    • go.sum
  • Files skipped - 2
    • charts/flyte-binary/README.md - Reason: Filter setting
    • charts/flyte-core/README.md - Reason: Filter setting
  • Tools
    • Golangci-lint (Linter) - ✖︎ Failed
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

AI Code Review powered by Bito Logo

@flyte-bot
Copy link
Collaborator

Changelist by Bito

This pull request implements the following key changes.

Key Change Files Impacted
Feature Improvement - Enhanced Agent Configuration in Helm Charts

values.yaml - Added timeouts and custom agent configuration

values.yaml - Added agent timeouts and custom agent settings

complete-agent.yaml - Updated agent configuration and security tokens

complete.yaml - Updated security tokens and checksums

dev.yaml - Updated security tokens and checksums

Testing - Agent Configuration Testing Updates

config.go - Added default agent deployment configuration

config_test.go - Added tests for agent deployment and task type matching

Other Improvements - Dependency Management Updates

go.mod - Removed unused dependencies

go.sum - Cleaned up and removed unused package dependencies

GetTask: 10s
supportedTaskTypes: []
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty supported task types array

Consider adding task types to the supportedTaskTypes array as an empty array may prevent the agent from handling any tasks. You might want to specify the task types this agent should support.

Code suggestion
Check the AI-generated fix before applying
Suggested change
supportedTaskTypes: []
supportedTaskTypes: ["noop_task"]

Code Review Run #5f1d05


Is this a valid issue, or was it incorrectly flagged by the Agent?

  • it was incorrectly flagged

Comment on lines +141 to +142
// Verify agent_1 was called (failed)
// agent1Client.AssertCalled(t, "CreateTask", mock.Anything, mock.Anything)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider enabling mock assertion check

The commented out assertion agent1Client.AssertCalled(t, "CreateTask", mock.Anything, mock.Anything) should be uncommented since it verifies that the agent client was called correctly. Without this assertion, the test is not fully validating the expected behavior.

Code suggestion
Check the AI-generated fix before applying
Suggested change
// Verify agent_1 was called (failed)
// agent1Client.AssertCalled(t, "CreateTask", mock.Anything, mock.Anything)
agent1Client.AssertCalled(t, "CreateTask", mock.Anything, mock.Anything)

Code Review Run #5f1d05


Is this a valid issue, or was it incorrectly flagged by the Agent?

  • it was incorrectly flagged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants